package com.skillscompetition.skillscompetition.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 技能表
 * </p>
 *
 * @author lwg
 * @since 2019-11-09
 */
@Data
@TableName("skillscontest")
public class SkillScontest implements Serializable, Comparable<SkillScontest> {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    @TableField(exist = false)
    private String number;//序号

    @TableField(exist = false)
    private String name;//姓名

    private Float theorys;

    private Float practicalOperationSum;

    private Float subtotal1;

    private Float subtotal2;

    private Float subtotal3;

    private Float operation1Referee1;

    private Float operation1Referee2;

    private Float operation1Referee3;

    private Float operation1Referee4;

    private Float operation1Referee5;

    private Float operation2Referee1;

    private Float operation2Referee2;

    private Float operation2Referee3;

    private Float operation2Referee4;

    private Float operation2Referee5;

    private Float operation3Referee1;

    private Float operation3Referee2;

    private Float operation3Referee3;

    private Float operation3Referee4;

    private Float operation3Referee5;

    private Float personageScores;

    private Integer examineeId;
    @TableField(exist = false)
    private Boolean flag=false;

    @Override
    public int compareTo(SkillScontest skillScontest) {
        if (this.personageScores > skillScontest.personageScores) {
            return -1;
        } else if (this.personageScores < skillScontest.personageScores) {
            return 1;
        } else {
            if (this.practicalOperationSum > skillScontest.practicalOperationSum) {
                return -1;
            } else if (this.practicalOperationSum < skillScontest.practicalOperationSum) {
                return 1;
            } else {
                if (this.subtotal1 > skillScontest.subtotal1) {
                    return -1;
                } else if (this.subtotal1 < skillScontest.subtotal1) {
                    return 1;
                } else {
                    if (this.subtotal2 > skillScontest.subtotal2) {
                        return -1;
                    } else if (this.subtotal2 < skillScontest.subtotal2) {
                        return 1;
                    } else {
                        if (this.subtotal3 > skillScontest.subtotal3) {
                            return -1;
                        } else if (this.subtotal3 < skillScontest.subtotal3) {
                            return 1;
                        } else {
                            this.flag = true;
                            skillScontest.flag = true;
                            return 0;
                        }
                    }
                }
            }
        }
    }
}
